/*
 * Copyright (c) 2002 - 2011
 * NetGroup, Politecnico di Torino (Italy)
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without 
 * modification, are permitted provided that the following conditions 
 * are met:
 * 
 * 1. Redistributions of source code must retain the above copyright 
 * notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright 
 * notice, this list of conditions and the following disclaimer in the 
 * documentation and/or other materials provided with the distribution. 
 * 3. Neither the name of the Politecnico di Torino nor the names of its 
 * contributors may be used to endorse or promote products derived from 
 * this software without specific prior written permission. 
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 * 
 */


#pragma once

/*!
	This signal is used to inform that the configuration must be updated
	and that the program must start working with the new parameters.

	In Win32, this signal is not generated. In order to accomplish this result,
	the service must be stopped and restarted again.
	In UNIX, this signal is generated when the user sends  a 'kill -HUP' signal;
	hence, it is mapped on the SIGHUP signal.

	When this signal is raised, the program is stopped and restarted again.
	Therefore, the current status of the program is not preserved.

	Therefore, this signal will call, in order, the functions <code>main_startup()</code>
	and <code>MainStopAndCleanup()</code>.

	This signal is used to force the program to reload its configuration without
	exiting.
*/
#ifndef WIN32
	#define SIGNAL_STOP_RELOAD_AND_RESTART SIGHUP
#endif


/*!
	This signal is generated by the system when a Ctrl+C is pressed.

	It is used to raise a STOP command; in this case, the function
	<code>MainStopAndCleanup()</code> is called.

	This signal is generated automatically on both Windows and Unix.
*/
#ifdef WIN32
	#define SIGNAL_CONTROLC SIGINT
#else
	#define SIGNAL_CONTROLC SIGINT
#endif


/*!
	This signal is used to inform that the program has to be shutted down.

	This signal is generated through a 'kill -TERM' in Unix, and it is generated 
	(by the code that handles service control, in this module) when a service 
	receives a 'stop' command.

	In Windows, we have to differentiate if the cleanup code must call exit() or not;
	hence we use two different signals. For instance, in case we're a service, we
	do not have to call the exit(), while if we are a console program, we do.
*/
#ifdef WIN32
	#define SIGNAL_KILLALL SIGTERM
	#define SIGNAL_KILLALL_NOEXIT SIGABRT
#else
	#define SIGNAL_KILLALL SIGTERM
#endif


